﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ch04
{
    class Class3
    {
        static void Main(string[] args)
        {
            int sum = 0;

            /*
            //10以内的基数和：1+3+5+7+9
            for (int i = 1; i <= 10; i+=2)
            {
                sum += i;
            }
            */

            int i = 1;  //表达式1

            for (;;)
            {
                if (i <= 10)    //表达式2
                    sum += i;
                else
                    break;

                i += 2; //表达式3
            }
            
            Console.WriteLine("10以内的基数和：{0}", sum);
        }
    }
}
